{template 'header'}

<body>
<div class="x-body">
    <form class="layui-form">
        <input type="hidden" name="id" value="{$user['id']}">
        <div class="layui-form-item">
            <label for="mobile" class="layui-form-label">
                <span class="x-red">*</span>手机号
            </label>
            <div class="layui-input-inline">
                <input type="text" id="mobile" name="mobile" required="" lay-verify="mobile"
                       autocomplete="off" class="layui-input" readonly value="{$user['mobile']}">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="alipay_name" class="layui-form-label">
                <span class="x-red"></span>支付宝姓名
            </label>
            <div class="layui-input-inline">
                <input type="text" id="alipay_name" name="alipay_name" required="" lay-verify="alipay_name"
                       autocomplete="off" class="layui-input" value="{$user['alipay_name']}">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="alipay_account" class="layui-form-label">
                <span class="x-red"></span>支付宝账号
            </label>
            <div class="layui-input-inline">
                <input type="text" id="alipay_account" name="alipay_account" required="" lay-verify="alipay_account"
                       autocomplete="off" class="layui-input" value="{$user['alipay_account']}">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="bank_card" class="layui-form-label">
                <span class="x-red"></span>银行卡号
            </label>
            <div class="layui-input-inline">
                <input type="text" id="bank_card" name="bank_card" required="" lay-verify="bank_card"
                       autocomplete="off" class="layui-input" value="{$user['bank_card']}">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="bank_truename" class="layui-form-label">
                <span class="x-red"></span>银行卡姓名
            </label>
            <div class="layui-input-inline">
                <input type="text" id="bank_truename" name="bank_truename" required="" lay-verify="bank_truename"
                       autocomplete="off" class="layui-input" value="{$user['bank_truename']}">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="bank_name" class="layui-form-label">
                <span class="x-red"></span>开户银行
            </label>
            <div class="layui-input-inline">
                <input type="text" id="bank_name" name="bank_name" required="" lay-verify="bank_name"
                       autocomplete="off" class="layui-input" value="{$user['bank_name']}">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="bank_branch" class="layui-form-label">
                <span class="x-red"></span>开户支行
            </label>
            <div class="layui-input-inline">
                <input type="text" id="bank_branch" name="bank_branch" required="" lay-verify="bank_branch"
                       autocomplete="off" class="layui-input" value="{$user['bank_branch']}">
            </div>
        </div>

        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button class="layui-btn" lay-filter="add" lay-submit="">
                修改
            </button>
        </div>
    </form>
</div>
<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;

        //自定义验证规则
        form.verify({
            user_pass: [/(.+){6,12}$/, '密码必须6到12位']
            , mobile: [/^1\d{10}$/, '输入正确的手机号码']
        });

        //监听提交
        form.on('submit(add)', function (data) {
            console.log(data);
            //发异步，把数据提交给php
            var url = '{php echo $this->createWebUrl("member_list",array("op"=>"edit"))}'
            $.post(url, data.field, function (ret) {
                if (ret.code) {
                    layer.msg("修改成功", {icon: 6}, function () {
                        //关闭当前frame
                        x_admin_close();
                        // 可以对父窗口进行刷新
                        x_admin_father_reload();
                    });
                } else {
                    layer.msg(ret.msg, {icon: 0});
                }
            }, 'json')
            return false;
        });


    });
</script>
<script>var _hmt = _hmt || [];
(function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
</body>
</html>